﻿using System.Windows.Forms;

namespace EFMLEditor.Internal.Dialogs
{
    public partial class NewItem : Form
    {
        public NewItem()
        {
            InitializeComponent();
        }
        public string SelectedItemType
        {
            get
            {
                if (listView1.SelectedItems[0] != null)
                    return listView1.SelectedItems[0].Text;
                return "";
            }
        }
        public string ItemName
        {
            get
            {
                return textBox1.Text;
            }
        }

        private void listView1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if(SelectedItemType == "String")
            {
                if(!textBox1.Text.EndsWith(".string"))
                {
                    textBox1.Text += ".string";
                }
            }
            if (SelectedItemType == "Window")
            {
                if (!textBox1.Text.EndsWith(".window"))
                {
                    textBox1.Text += ".window";
                }
            }
        }
    }
}
